    <thead>
    <tr>
        <th width="20">No.</th>
        <th data-order-field="ip" width="70">代理IP</th>
        <th data-order-field="planDate" width="80">计划执行时间</th>
        <th data-order-field="actualDate" width="80">实际执行时间</th>
        <th data-order-field="note" >备注</th>
        <th data-order-field="status" width="50">状态</th>
        <th data-order-field="team" width="50">组别</th>
        <th></th>
    </tr>
    </thead>
    <tbody>
    <#list array as row>
    <tr>
        <td>${(row_index+1)!}</td>
        <td>(${(row.bizUnit)!})<#--${(row.clientIp)!}--><a href="/admin/agent/detail?agentId=${(row.agentId)!}" data-width="700" data-toggle="dialog"  data-id="form"  data-title="代理IP">${(row.clientIp)!}</a></td>
        <td>${(row.planDate?string('yy/MM/dd HH:mm:ss'))!}</td>
        <td>${(row.actualDate?string('yy/MM/dd HH:mm:ss'))!}</td>
        <td title="${(row.note)!}"><#--<@p.subStr content=(row.note)! length=30/>--><a href="/file/${(row.artifactId)!}"><@p.subStr content=(row.note)! length=30/></a></td>
        <td <#if row.status=='FAIL'>style="background-color:red"</#if> >${(row.status.label)!}</td>
        <td>${(row.team.label)!}</td>
        <td>
            <a href="/admin/task/preview?id=${(row.id)!}" class="btn btn-default" data-toggle="dialog" data-id="form"  data-title="命令预览">预览</a>
        <#--<#if row.status=='NEW'>-->
            <#--<a href="javascript:runTask('${(row.id)!}','${(jobId)!}')" class="btn btn-blue" >运行</a>-->
        <#--<#elseif row.status=='FAIL'>-->
            <#--<a href="/admin/task/run?id=${(row.id)!}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要再次运行吗？">运行</a>-->
        <#--<#else>-->
            <#--<a href="javascript:runTask('${(row.id)!}','${(jobId)!}')" class="btn btn-blue" disabled="true">运行</a>-->
        <#--</#if>-->

            <#if row.status??&&row.status.logAble>
                <a href="/admin/task/log?id=${(row.id)!}" class="btn btn-default" data-toggle="dialog" data-max="true" data-id="form"  data-title="日志">日志</a>
            <#else>
                <#if job.auditState??&&job.auditState.runAble>
                    <a href="javascript:runTask('${(row.id)!}','${(jobId)!}')" class="btn btn-blue" >运行</a>
                </#if>
            </#if>


        </td>

    </tr>
    </#list>
    </tbody>
    <script>

        $(function(){
            refreshTaskDiv();
        });

        function refreshTaskDiv()
        {
            if(nIntervId==null)//新进入job/list页面时
            {
                nIntervId = setInterval(refreshByJobId, 5000);
            }
            else  //在job/list页面点击不同记录
            {
                clearInterval(nIntervId);
                nIntervId = setInterval(refreshByJobId, 5000);
            }
        }

        function refreshByJobId()
        {
            if($('#listTask').length==0)//离开joblist页面
            {
                clearInterval(nIntervId);
                return;
            }
            var jobId = '${(jobId)!}';
            listByJob(jobId);
        }
    </script>



